<template>
    <van-nav-bar title="商品订单" left-text="" left-arrow @click-left="onClickLeft" :fixed="true" :placeholder="true" />
    <div class="tabs">
        <van-tabs v-model:active="active" >
            <van-tab title="今日"></van-tab>
            <van-tab title="本月"></van-tab>
            <van-tab title="本年"></van-tab>
            <van-tab title="自定义时间"></van-tab>
        </van-tabs>
        <div class="sumTitle">
            <title-item title1st="总计" subTitle="¥200.00"> </title-item>
        </div>
    </div>

    <div class="content">
        <div v-for="i in 20">
            <div class="item">
                <div class="left">
                    <span>自助洗车</span>
                    <span class="useFunc">店铺名称：糖水铺</span>
                </div>
                <div class="right">
                    <div class="mar-rig">端午节卡包(<span class="xyColor">核销价格：4</span>)</div>
                    <div>本单收益：<span class="redColor">+10</span></div>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup>
import TitleItem from "@/components/title-item/title-item.vue";
import { useRouter } from 'vue-router'
const router = useRouter();
import { onMounted, ref } from 'vue';
const active = ref(0);
// 返回按钮
const onClickLeft = () => {
    router.back();
};
onMounted(()=>{
    console.log(11111)
})
</script>
<style lang="scss" scoped>
::v-deep .van-tabs__line {
    background: #218CC9 !important;
}

::v-deep .van-tabs {
    // padding: 0 !important;
    padding-right: 50px;
}

::v-deep .van-tab--active {
    color: #2CB9A4 !important;
}

.tabs {
    position: sticky !important;
    top: 46px !important;
    z-index: 10 !important;
    background: #fff;
    .sumTitle{
        margin-left: -4px;
        margin-top: 10px;
        padding-right: 20px;
    }
}


.content {
    padding: 10px 20px 20px 20px;

    .item {
        display: flex;
        flex-direction: column;
        padding-bottom: 10px;
        border-bottom: 1px solid #DADADA;

        .left {
            color: rgba(84, 84, 84, 1);
            font-family: PingFang SC;
            font-size: 14px;
            font-style: normal;
            font-weight: 500;
            line-height: normal;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 10px 0;

            .useFunc {}
        }

        .right {
            display: flex;
            align-items: center;
            justify-content: space-between;

            &:first-child {
                color: #1D1B20;
                font-family: PingFang SC;
                font-size: 14px;
                font-style: normal;
                font-weight: 400;
                line-height: normal;
            }

            &:last-child {
                // color: #979797;
                color: #1D1B20;
                font-family: PingFang SC;
                font-size: 14px;
                font-style: normal;
                font-weight: 400;
                line-height: normal;
            }

            .xyColor {
                color: rgba(44, 185, 164, 1);
            }

            .redColor {
                color: rgba(255, 102, 102, 1)
            }
        }

        .mar-rig {
            margin-right: 10px;
        }
    }
}
</style>